package com.cll.learn.provider2.service.impl;

import com.cll.learn.api.service.UserService;
import com.cll.learn.filter.DubboTraffic;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2020/10/9 15:29
 */
@DubboService(interfaceClass = UserService.class, version = "1.0.0")
@Component
public class UserServiceImpl implements UserService {

    @Override
    public String getUser(String username) {
        System.out.println("服务提供者2接收到参数 = " + username);
        String requestIp = DubboTraffic.getRequestIp();
        System.out.println("ip = " + requestIp);
        return "[" + username + "]用户，你好! 请求IP = [" + requestIp + "]";
    }
}
